import xlrd


common_header = []
# filepath = "./B-2廖铸_现有目录.xls"
filepath = input("请输入文件路径：")

data = xlrd.open_workbook(filepath)
names = data.sheet_names()
t_data = {}

for name in names:
    t_common_header = []
    table = data.sheet_by_name(name)
    data.sheet_loaded(name)

    """取公共表头"""
    for i in range(4):
        t_common_header.append(table.row_values(i))

    t_data["common_header"] = t_common_header

common_header.append(t_data)

filelist = []
filename = ""
for a in common_header[0].values():
    filelist = a[:]

    filename = filelist[1][0]

del filelist[1]
# print(filename)
common_header[0]["common_header"] = filelist
# print(common_header)
